package models

import (
	"time"
)

const TBNTask = "task"

type TblTask struct {
	Id        int64      `orm:"" json:"id" form:"id"`
	CreateAt  *time.Time `orm:"" json:"createAt" form:"createAt"`
	App       string     `orm:"varchar(20);comment:系统名" json:"app" form:"app"`
	Key       string     `orm:"varchar(30);comment:任务唯一标识" json:"key" form:"key"`
	Name      string     `orm:"varchar(40);comment:任务名" json:"name" form:"name"`
	Status    int        `orm:"tinyint;comment:-1-已删除 1-暂停 2-正常" json:"status" form:"status"`
	Spec      string     `orm:"varchar(40)" json:"spec" form:"spec"`
	Params    string     `orm:"varchar(500);comment:执行任务时参数" json:"params" form:"params"`
	Registers string     `orm:"text;comment:注册可执行的实例，IP:PORT，多个逗号隔开" json:"registers" form:"registers"`
	Runner    string     `orm:"varchar(100);comment:执行中实例，IP:PORT" json:"runner" form:"runner"`
	Remark    string     `orm:"varchar(100)" json:"remark" form:"remark"`
}

func (m *TblTask) TableName() string {
	return TBNTask
}
